<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
	<c:set var="emp" value="${sessionScope.user}"/>
	
<div class="mailbox row">
	<div class="col-xs-12">
		<div class="box box-solid">
			<div class="box-body">
				<div class="row">
					<div class="col-md-2">
						<!-- --------- 分类导航 start------------- -->
						<div style="margin-top: 15px;">
							<ul class="nav nav-pills nav-stacked">
								<li class="header">部门管理</li>
								<c:if test="${empty param.status}">
									<li class="active"><a href="${initParam.root}/department?status=24"><i class="fa fa-search"></i>查看所有部门</a></li>
									<li><a href="${initParam.root}/department-info"><i class="fa fa-plus-circle"></i>添加部门</a></li>
								</c:if>
								<c:if test="${not empty param.status}">
									<li class="${param.status==24?'active':''}"><a href="${initParam.root}/department?status=24"><i class="fa fa-search"></i>查看所有部门</a></li>
									<li class="${param.status==21?'active':''}"><a href="${initParam.root}/department-info"><i class="fa fa-plus-circle"></i>添加部门</a></li>
								</c:if>
							</ul>
						</div>
						<!-- --------- 分类导航 end------------- -->
					</div>
					<!-- /.col (LEFT) -->
					<div class="col-md-10">
						<div class="row pad">
							<!-- --------- 搜索 start------------- -->
							<!-- <div class="col-sm-12 search-form"> -->
								<form action="#" class="" method="get">
									<div class="col-md-4">
										<label>部门ID:</label><input type="text" name="id"/>
									</div>
									<div class="col-md-4">
										<label>部门名:</label>
										<input name="name" type="text" value="">
										<button type="submit" class="btn btn-sm btn-primary" style="display:inline">
											搜索
										</button>
									</div>
									<div class="col-md-4">
										
									</div>
								</form>
							<!--</div>-->
							<!-- --------- 搜索 end------------- -->
						</div>
						<!-- /.row -->
						<!-- 	1.table-responsive放在table的上一级
								2.td里的内容增多
								  才会出现滚动条！ -->
						<div class="table-responsive">
							<!-- --------- 列表 start------------- -->
							<table class="table table-mailbox info">
								<thead>
									<tr>
										<th>部门名</th><th>描述</th><th>状态</th><th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="dept" items="${allDepartment}">
										<tr>
											<td>${dept.name }</td>
											<td>${dept.description }</td>
											<td>${dept.status==1?'正常':'注销' }</td>
											<td>
												<a class="btn btn-primary" style="color:white;" href="${initParam.root}/department-info?id=${dept.id}">编辑</a>
												<form action="${initParam.root}/department-logout" method="post" style="display: inline">
													<input type="hidden" value="${dept.id }" name="id"/>
													<button type="submit" class="btn btn-danger">注销</button>
												</form>
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<!-- --------- 列表 end------------- -->
						</div>
						<!-- /.table-responsive -->
					</div>
					<!-- /.col (RIGHT) -->
				</div>
				<!-- /.row -->
			</div>
			<!-- /.box-body -->
			<div class="box-footer clearfix">
				<div class="pull-right">
					<small>显示<span>第1页</span>共1页</small>
						<a href="#" class="btn btn-xs btn-primary">
							<i class="fa fa-caret-left"></i>
						</a>
						<a href="#" class="btn btn-xs btn-primary">
							<i class="fa fa-caret-right"></i>
						</a>
				</div>
			</div>
			<!-- box-footer -->
		</div>
		<!-- /.box -->
	</div>
	<!-- /.col (MAIN) -->
</div>
<!-- MAILBOX END -->